<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-lg-10 col-lg-offset-1">
		<div class="card card-block">
				<form action="<?php echo url("plugin-setting-sg_hide");?>" method="post" id="form">
					<h4 class="card-title">登陆/回复可见设置</h4>
					<div class="form-group row">
						<label class="form-control-label">开启登陆可见选项</label>
						<label class="m-r-3 c-input c-checkbox"><input type="checkbox" name="hide1" value="1" <?php echo ($hide1 ? 'checked' : ''); ?> /><span class="c-indicator"></span></label>
						<label class="form-control-label">开启回复可见选项</label>
						<label class="c-input c-checkbox"><input type="checkbox" name="hide2" value="1" <?php echo ($hide2 ? 'checked' : ''); ?> /><span class="c-indicator"></span></label>
					</div>
					<p class="text-center">
						<button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
						<a role="button" class="btn btn-secondary btn-block m-t-1" href="javascript:history.back();"><?php echo lang('back');?></a>
					</p>
				</form>
			</div>
	</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>

var jform = $("#form");
var jsubmit = $("#submit");
var referer = '<?php echo http_referer();?>';
jform.on('submit', function(){
	jform.reset();
	jsubmit.button('loading');
	var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			$.alert(message);
			jsubmit.text(message).delay(2000).button('reset').location(referer);
			return;
		} else {
			$.alert(message);
			jsubmit.button('reset');
		}
	});
	return false;
});

</script>